const Router =  require('../koa-router-master/lib/router');
const router=new Router();

router.prefix('/api/dome');
router.use(async(ctx,next)=>{
    ctx.response.type='json';
    await next();
})
router.get('/set', async (ctx,next)=>{
	const n = Number(ctx.cookies.get('view') || 0) + 1;
    ctx.cookies.set('view', n);
    ctx.response.body = n + ' views';
})

module.exports = router